/*
 * Copyright (C) 2010-2011 Comcast Cable.  All Rights Reserved.
 */
package com.hercules.android.receiver.model.commands;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * <p>This is a subclass of XRECommand that represents a NEW XRE command. It defines some properties specific to this
 * command. According to XRE protocol specification, this command is used for creating XRE objects. It is a simple
 * JavaBean (POJO) that provides getters and setters for all private attributes and performs no argument validation in
 * the setters.</p>
 *
 * <p><strong>Thread safety:</strong> This class is mutable and not thread safe.</p>
 *
 * @author saarixx, jmn
 * @version 1.0
 */
public class XRENewCommand extends XRECommand {

    /**
     * <p>The command name associated with this class.</p>
     *
     * <p>Immutable string constant.</p>
     *
     * <p>Is used in getCommand().</p>
     */
    public static final String COMMAND_NAME = "NEW";

    /**
     * <p>The ID of the new object.</p>
     *
     * <p>Can be any value.</p>
     *
     * <p>Has getter and setter.</p>
     */
    private int id;

    /**
     * <p>The class name of the object to instantiate.</p>
     *
     * <p>Can be any value.</p>
     *
     * <p>Has getter and setter.</p>
     */
    private String klass;

    /**
     * <p>The map of construction properties to assign to the new object. Keys are property names, values - new property
     * values.</p>
     *
     * <p>Can be any value, can contain any values.</p>
     *
     * <p>Has getter and setter.</p>
     */
    private Map<String, Object> params = new LinkedHashMap<String, Object>();

    /**
     * <p>Creates new instance of {@link XRENewCommand} class.</p>
     */
    public XRENewCommand() {
        // empty constructor
    }

    /**
     * <p>Retrieves the name of this command.</p>
     *
     * @return the name of this command
     */
    public String getCommand() {
        return COMMAND_NAME;
    }

    /**
     * <p>Retrieves the ID of the new object.</p>
     *
     * @return the ID of the new object
     */
    public int getId() {
        return id;
    }

    /**
     * <p>Sets the ID of the new object.</p>
     *
     * @param id the ID of the new object
     */
    public void setId(int id) {
        this.id = id;
    }

    /**
     * <p>Retrieves the class name of the object to instantiate.</p>
     *
     * @return the class name of the object to instantiate
     */
    public String getKlass() {
        return klass;
    }

    /**
     * <p>Sets the class name of the object to instantiate.</p>
     *
     * @param klass the class name of the object to instantiate
     */
    public void setKlass(String klass) {
        this.klass = klass;
    }

    /**
     * <p>Retrieves the map of construction properties to assign to the new object.</p>
     *
     * @return the map of construction properties to assign to the new object
     */
    public Map<String, Object> getParams() {
        return params;
    }

    /**
     * <p>Sets the map of construction properties to assign to the new object.</p>
     *
     * @param params the map of construction properties to assign to the new object
     */
    public void setParams(Map<String, Object> params) {
        this.params = params;
    }

}

